/*
 * Copyright (c) 2025, 大连理工大学 (Dalian University of Technology)
 *
 * Licensed under the Mulan PSL v2.
 * You can use this file according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of the License at
 *
 *     http://license.coscl.org.cn/MulanPSL2
 *
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. SEE THE MULAN PSL v2
 * FOR MORE DETAILS.
 */

#pragma once
#include "DataStructure/Result/ResultDomains.h"

#include "DBManager/IRepository/Base/IMainlyRepository.h"

/**
 * @class IResultDomainsRepository
 * @brief 管理domains数据的接口。
 *
 * 该类提供用于添加和检索domains数据的接口。
 */
class IResultDomainsRepository : public virtual IMainlyRepository<SG::DataStructure::Post::ResultDomains>
{
  public:
    /**
     * @brief 根据仓库内容，更新m_MaxDomainID
     *
     */
    virtual void UpdataMaxDomainId () = 0;

    /**
     * @brief   : 获取所有数据
     * @return  :
     * @author  : wxc
     * @date    : 2024.11.06
     */
    virtual std::vector<IMainlyRepository::DataType> GetAllData () = 0;

    SG::DataStructure::Common::Id GetMaxId () const
    {
        return m_MaxDomainId;
    }

    void SetMaxId (const SG::DataStructure::Common::Id &MaxDomainId)
    {
        m_MaxDomainId = MaxDomainId;
        m_MaxDomainId = MaxDomainId;
    }

  private:
    SG::DataStructure::Common::Id m_MaxDomainId = -1;  ///< 记录当前仓库最大DomainID，-1表示未更新
};